package org.spring.boot.func;

import org.spring.boot.func.factory.FuncFactory;
import org.spring.boot.func.properties.FuncProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Anonymous function autowiring
 * @author Yiur
 */
@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties({FuncProperties.class})
public class FuncAutoConfiguration {

    /**
     * Logger
     */
    private static final Logger logger = LoggerFactory.getLogger(FuncAutoConfiguration.class);
    /**
     * FuncFactory
     */
    private final FuncFactory funcFactory;

    public FuncAutoConfiguration(FuncProperties funcProperties) {
        this.funcFactory = new FuncFactory(funcProperties);
    }

    @Bean
    public FuncFactory funcFactory() {
        return funcFactory;
    }

}
